﻿@model IEnumerable<ArivisTests.Models.TestPlan>
@using ArivisTests.Views;

@{
    ViewBag.Title = "Test Plans";
}

@section Navigation{
    @ViewBag.Title
}

<table class="index-table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Tests)
        </th>
        <th>
            Duration
        </th>
        <th style="width:1%;"></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.Name, "Details", new { id=item.Id })
        </td>
        <td>
            @item.Tests.Count()
        </td>
        <td>
            @Html.FormatMinutes(item.Tests.Sum(x => x.Duration))
        </td>
        <td style="white-space:nowrap">
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}
</table>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
